<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>二手交易平台</title>
  <link rel="stylesheet" type="text/css" href="/ssm/consumer/res/static/css/main.css">
  <link rel="stylesheet" type="text/css" href="/ssm/consumer/res/layui/css/layui.css">
  <script type="text/javascript" src="/ssm/consumer/res/layui/layui.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
   <link rel="stylesheet" href="/ssm/static/system/layui/css/layui.css"
          media="all" />
  <style type="text/css">
  	.userNotLogin{
  		display: none;
  	}
  	.layui-form-onswitch i {
	    left: 32px;
	     margin-left: 0px; 
	    background-color: #fff;
	}
	.layui-form-label {
	    float: left;
	    display: block;
	    padding: 9px 15px;
	    width: 180px;
	    font-weight: 400;
	    line-height: 20px;
	    text-align: right;
	}
	.layui-form-item .layui-input-inline {
	    float: left;
	    width: 390px;
	    margin-right: 10px;
	}
  </style>
</head>
<body>

  <div class="site-nav-bg">
    <div class="site-nav w1200">
      <p class="sn-back-home">
        <i class="layui-icon layui-icon-home"></i>
        <a href="/ssm/consumer/index.html">首页</a>
      </p>
      <div class="sn-quick-menu">
        	<div class="userLogin">
        		<div class="login"><a href="/ssm/consumer/login.html">登录</a></div>
        		<div class="login"><a href="/ssm/consumer/register.html">注册</a></div>
        	</div>
        	<div class="userNotLogin">
        		<div class="login"><a href="/ssm/consumer/userInfo.html" id="username">用户名</a></div>
        		<div class="login"><a href="JavaScript:loginOut();">退出</a></div>
        		<div class="login"><a href="/ssm/consumer/myOrder.html">我的订单</a></div>
        		<div class="sp-cart"><a href="/ssm/consumer/shopcart.html">购物车</a></div>
        	</div>
      </div>
    </div>
  </div>



  <div class="header">
    <div class="headerLayout w1200">
      <div class="headerCon">
        <h1 class="mallLogo">
           <a href="/ssm/consumer/index.html" title="">
            <img src="/ssm/consumer/res/static/img/logo.png">
          </a>
        </h1>
        <div class="mallSearch">
          <form action="" class="layui-form" novalidate>
            <input type="text" id="keyword" name="title" required  lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入需要的商品">
            <button class="layui-btn" id="searchbutton" lay-filter="formDemo" onclick="return false">
                <i class="layui-icon layui-icon-search"></i>
            </button>
            <input type="hidden" name="" value="">
          </form>
        </div>
      </div>
    </div>
  </div>


   <div class="content content-nav-base shopcart-content">
    <div class="main-nav">
      <div class="inner-cont0">
        <div class="inner-cont1 w1200">
          <div class="inner-cont2">
            <a href="/ssm/consumer/index.html">首页</a>
          </div>
          <div class="inner-cont2">
            <a href="/ssm/consumer/myProduct.html" >我的商品</a>
          </div>
          <div class="inner-cont2">
            <a href="/ssm/consumer/myCommnet.html" class="active">评论回复</a>
          </div>
        </div>
      </div>
    </div>
    <div class="banner-bg w1200">
    </div>
    <div class="cart w1200">
    
  	<table class="layui-table" id="supplierTable" lay-filter="table">
  		<caption>消费者留言</caption>
  	</table>
  	<script type="text/html" id="barTpl">
   {{# if(d.reply === null){ }}
	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="edit" shiro:hasPermission="role_send">回复</a>
	{{# } }}
	</script>
	<script type="text/html" id="statusTpl">
  </div>
  
</div>  

<script type="text/javascript">
  layui.config({
    base: '/ssm/consumer/res/static/js/util/' //你存放新模块的目录，注意，不是layui的模块目录
  }).use(['mm','jquery','element'],function(){
    var mm = layui.mm,$ = layui.$,element = layui.element;

});
</script>

<script type="text/html" id="addModel">
    <form id="editForm" class="layui-form model-form" action="">
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  			<legend>留言回复</legend>
		</fieldset>
        <input id="id" type="hidden" value=""/>
        <div class="layui-form-item">
            <label class="layui-form-label">留言：</label>
            <div class="layui-input-inline">
                <input id="content" autocomplete="off" placeholder="请输入留言"  type="text" class="layui-input"  lay-verify="required" required />
            </div>
        </div>
		<div class="layui-form-item">
            <label class="layui-form-label">回复：</label>
			<div class="layui-input-inline">
                <textarea id="reply" autocomplete="off" placeholder="请输入回复"  type="text" class="layui-textarea"  lay-verify="required" required />
            </div>
		</div>
        <div class="layui-form-item model-form-footer">
            <button class="layui-btn layui-btn-primary" type="button" id="btnCancel">取消</button>
            <button class="layui-btn" lay-filter="btnSubmit" lay-submit>保存</button>
        </div>
    </form>
</script>

<script type="text/javascript" src="/ssm/consumer/js/jquery-1.4.3.min.js"></script>
<script type="text/javascript"
        src="/ssm/static/system/layui/layui.js"></script>
<script type="text/javascript"
        src="/ssm/static/system/js/comment/comment.js"></script>
<script type="text/javascript">

$("#searchbutton").click(function Search(){
	location.href="/ssm/consumer/index.html?pname="+$("#keyword").val();
	return false;
})

$("#keyword").val(getQueryString('pname'));


var info;
getUserInfo();
function  getUserInfo(){
    $.ajax({
        url:"/ssm/consumer/loginInfo.do",
        type:"POST",
        dataType:"json",
        success:function(data){
        	info = data.body
           if(info!=null){
        	   $(".userLogin").hide();
        	   $("#username").text(info.real_name);
        	   $(".userNotLogin").show();
           }else{
        	   location.href="/ssm/consumer/login.html";
           }
        } 
    })
 }
 
function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return decodeURI(r[2]); return null;
} 

function loginOut(){
	$.post('/ssm/consumer/logout.do',function(){
		
		location.href="/ssm/consumer/login.html";
	})
}

function updateState(oid,state){
	var postData = {
			oid:oid,
			state:state,
			
	}
	$.post('/ssm/order/updateStatus.do',postData,function(data){
		location.reload();
	})
	
}
</script>
</body>
</html>